//**********************************************************
//    File Name: UserRole.cs
//    Author: Team Motif
//    Date Created : 04/13/2007
//    Current Owner: Team Motif 
//                                                                            
//    Purpose: 
//    This class provides the functions needed to manipulate the role of a user.
//
//	  Copyright 2007
//**********************************************************

using System;
using System.Collections.Generic;
using System.Text;

namespace Library
{
    public enum EmployeeType
    {
        Supervisor,
        HomeCareWorker,
        DayCenterWorker
    }

    /// <summary>
    /// -------------------------------------------------------------------------------
    /// This struct contains information about the user and CRUD permissions
    /// -------------------------------------------------------------------------------
    /// </summary>
    public struct Permissions
    {
        public bool read;
        public bool write;
        public bool create;
        public EmployeeType type;
    }

    public class UserRole
    {
        /// <summary>
        /// -------------------------------------------------------------------------------
        /// Constructor for the UserRole class
        /// -------------------------------------------------------------------------------
        /// </summary>
        public UserRole()
        {
            // defaulting user to full permissions for now
            mRole.type = EmployeeType.Supervisor;
            mRole.write = true;
            mRole.read = true;
            mRole.create = true;
        }

        /// <summary>
        /// -------------------------------------------------------------------------------
        /// Returns the current permissions for this user
        /// -------------------------------------------------------------------------------
        /// </summary>
        public Permissions GetPermissions()
        {
            return mRole;
        }

        // -------------------------------------------------------------------------------
        // Private data region.
        // -------------------------------------------------------------------------------
        Permissions mRole;
    }
}
